Views [dbo].[vProcessTypeDefaultOwnerAllUsers]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created3:38:27 PM Friday, January 07, 2011
Last Modified1:49:18 PM Thursday, September 22, 2011
Columns
Name
FullName
UserId
UserKey
SQL Script
CREATE VIEW [dbo].[vProcessTypeDefaultOwnerAllUsers]
AS
SELECT [dbo].[ContactMain].[FullName], [dbo].[UserMain].[UserId], [dbo].[UserMain].[UserKey]
FROM [dbo].[UserMain]
INNER JOIN [dbo].[ContactMain] ON [dbo].[UserMain].[UserKey] = [dbo].[ContactMain].[ContactKey]
INNER JOIN [dbo].[GroupMember] ON [dbo].[GroupMember].[MemberContactKey] = [dbo].[UserMain].[UserKey]
INNER JOIN [dbo].[SystemConfig] ON [dbo].[GroupMember].[GroupKey] = [dbo].[SystemConfig].[ParameterValue]
WHERE (([dbo].[UserMain].[IsDisabled] = 0)) AND ([dbo].[SystemConfig].[ParameterName] = 'OppOwnerGroupKey'
OR [dbo].[SystemConfig].[ParameterName] = 'OppAdminGroupKey')
UNION
SELECT [dbo].[ContactMain].[FullName], [dbo].[UserMain].[UserId], [dbo].[UserMain].[UserKey]
FROM [dbo].[UserMain]
INNER JOIN [dbo].[ContactMain] ON [dbo].[UserMain].[UserKey] = [dbo].[ContactMain].[ContactKey]
INNER JOIN [dbo].[Name] ON [dbo].[ContactMain].[SyncContactID] = [dbo].[Name].[ID]
INNER JOIN [dbo].[Name_Fin] ON [dbo].[Name].[ID] = [dbo].[Name_Fin].[ID]
INNER JOIN [dbo].[UserRole] ON [dbo].[UserMain].[UserKey] = [dbo].[UserRole].[UserKey]
INNER JOIN [dbo].[RoleMain] ON [dbo].[UserRole].[RoleKey] = [dbo].[RoleMain].[RoleKey]
WHERE (([dbo].[UserMain].[IsDisabled] = 0)) AND [dbo].[RoleMain].[Name] = 'SysAdmin'

GO
Uses